package cn.zy.jboa.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * SysDepartment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_department")
public class SysDepartment implements java.io.Serializable {

	// Fields

	private Integer id;
	private String name;
	private Set<SysEmployee> sysEmployees = new HashSet<SysEmployee>(0);
	private Set<BizClaimVouyearStatistics> bizClaimVouyearStatisticses = new HashSet<BizClaimVouyearStatistics>(
			0);
	private Set<BizClaimVoucherStatistics> bizClaimVoucherStatisticses = new HashSet<BizClaimVoucherStatistics>(
			0);

	// Constructors

	/** default constructor */
	public SysDepartment() {
	}

	/** minimal constructor */
	public SysDepartment(String name) {
		this.name = name;
	}

	/** full constructor */
	public SysDepartment(String name, Set<SysEmployee> sysEmployees,
			Set<BizClaimVouyearStatistics> bizClaimVouyearStatisticses,
			Set<BizClaimVoucherStatistics> bizClaimVoucherStatisticses) {
		this.name = name;
		this.sysEmployees = sysEmployees;
		this.bizClaimVouyearStatisticses = bizClaimVouyearStatisticses;
		this.bizClaimVoucherStatisticses = bizClaimVoucherStatisticses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "NAME", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysDepartment")
	public Set<SysEmployee> getSysEmployees() {
		return this.sysEmployees;
	}

	public void setSysEmployees(Set<SysEmployee> sysEmployees) {
		this.sysEmployees = sysEmployees;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysDepartment")
	public Set<BizClaimVouyearStatistics> getBizClaimVouyearStatisticses() {
		return this.bizClaimVouyearStatisticses;
	}

	public void setBizClaimVouyearStatisticses(
			Set<BizClaimVouyearStatistics> bizClaimVouyearStatisticses) {
		this.bizClaimVouyearStatisticses = bizClaimVouyearStatisticses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysDepartment")
	public Set<BizClaimVoucherStatistics> getBizClaimVoucherStatisticses() {
		return this.bizClaimVoucherStatisticses;
	}

	public void setBizClaimVoucherStatisticses(
			Set<BizClaimVoucherStatistics> bizClaimVoucherStatisticses) {
		this.bizClaimVoucherStatisticses = bizClaimVoucherStatisticses;
	}

}